<?php

/**
 * Api Model 类
 * @author: 喵了个咪  <wenzhenxi@vip.qq.com> 2015-07-23
 */
class Model_ProjectApi extends PhalApi_Model_NotORM {

    protected function getTableName($id) {

        return 'project_api';
    }

    /**
     * 通过项目的ID 获取有哪些接口
     */
    public function getpIdByapiIdList($projectId) {

        return $this->getORM()->select('apiId')->where('pId', $projectId)->fetchAll();
    }

    /**
     * 通过项目Id 和 用户API Id 验证
     */
    public function getApiIdListOrProId($ApiIdList, $ProId) {

        return $this->getORM()->select('apiId')->where('pId', $ProId)->where('apiId', $ApiIdList)->fetchAll();
    }
}
